package io;


import java.io.*;

public class CopyDemo3Buffered {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("aaa.png"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("aaa_.png"));
        long start = System.currentTimeMillis();
        int d;
        while ((d = bis.read())!=-1){
            bos.write(d);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完成,耗时"+(end-start)+"ms");
        bos.close();
        bis.close();
    }

}
